/*
*    l3qd - Light, light, lightweight queue
*    Copyright (C) 2024  Marcus Pedersén marcus@marcux.org
*
*    This program is free software: you can redistribute it and/or modify
*    it under the terms of the GNU General Public License as published by
*    the Free Software Foundation, either version 3 of the License, or
*    (at your option) any later version.
*
*    This program is distributed in the hope that it will be useful,
*    but WITHOUT ANY WARRANTY; without even the implied warranty of
*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*    GNU General Public License for more details.
*
*    You should have received a copy of the GNU General Public License
*    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package cmd

import (
	"fmt"
	"github.com/spf13/cobra"
	"notabug.org/marcux/l3q/internal/common"
)

var versionCmd = &cobra.Command{
	Use:   "version",
	Short: "Print version and exit.",
	Long: `Description:
  Print version and exit.`,
	Run: func(cmd *cobra.Command, args []string) {
		common.AsciiL3q()
		fmt.Printf("l3q %s\n", common.VERSION)
		fmt.Printf("%s\n", common.COPYRIGHT)
		fmt.Println("License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.")
		fmt.Println("This is free software: you are free to change and redistribute it.")
		fmt.Println("There is NO WARRANTY, to the extent permitted by law.")
		fmt.Println("")
		fmt.Println("Written by Marcus Pedersén.")
	},
}
